-- GENERATED SPELL FOR [Crystalline Protector] --


function spell0_26792(pUnit, Event) --@Crystal Chains,n/a--
pUnit:FullCastSpellOnTarget(47698,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26792', 6343, 1)
end

function spell1_26792(pUnit, Event) --@Crystal Chains,n/a--
pUnit:FullCastSpellOnTarget(57050,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26792', 6251, 1)
end

function spell2_26792(pUnit, Event) --@Shard Spray,Self--
pUnit:FullCastSpellOnTarget(50302,pUnit)
pUnit:RegisterEvent('Sorts_26792', 529, 1)
end

function spell3_26792(pUnit, Event) --@Shard Spray,Self--
pUnit:FullCastSpellOnTarget(57051,pUnit)
pUnit:RegisterEvent('Sorts_26792', 583, 1)
end

function spell4_26792(pUnit, Event) --@Thunderclap,Self--
pUnit:FullCastSpellOnTarget(30633,pUnit)
pUnit:RegisterEvent('Sorts_26792', 11000, 1)
end

function Sorts_26792(pUnit, Event)
local choix_sorts_26792 = math.random(0, 4)
if choix_sorts_26792 == 0 then
pUnit:RegisterEvent('spell0_26792', 1, 1)
end
if choix_sorts_26792 == 1 then
pUnit:RegisterEvent('spell1_26792', 1, 1)
end
if choix_sorts_26792 == 2 then
pUnit:RegisterEvent('spell2_26792', 1, 1)
end
if choix_sorts_26792 == 3 then
pUnit:RegisterEvent('spell3_26792', 1, 1)
end
if choix_sorts_26792 == 4 then
pUnit:RegisterEvent('spell4_26792', 1, 1)
end
end

function mob26792_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_26792', math.random(1500, 3000), 1)
end

function mob26792_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26792_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26792_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(26792, 1, 'mob26792_Action')
RegisterUnitEvent(26792, 2, 'mob26792_Leave')
RegisterUnitEvent(26792, 3, 'mob26792_Kill')
RegisterUnitEvent(26792, 4, 'mob26792_Die')
